import request from '@/plugins/axios/request';
let baseURL = process.env.VUE_APP_BASE_API + "/flow/role"

// 查询用户列表
export function getRoleList(data) {
  return request({
    url: `${baseURL}/roleList`,
    method: 'POST',
    data: data,
    isShowMessage: false
  })
}


export function addRole(data) {
  return request({
    url: `${baseURL}/addRole`,
    method: 'post',
    data: data,
    isShowMessage: true
  })
}


export function allMenuList(data) {
  return request({
    url: `${baseURL}/allMenuList`,
    method: 'get',
    params: data,
    isShowMessage: false
  })
}


export function updatePermission(data) {
  return request({
    url: `${baseURL}/updatePermission`,
    method: 'PUT',
    data: data,
    isShowMessage: false
  })
}


export function permissionDetail(data) {
  return request({
    url: `${baseURL}/permissionDetail/${data.id}`,
    method: 'get',
    params: data,
    isShowMessage: false
  })
}


export function updateRole(data) {
  return request({
    url: `${baseURL}/updateRole`,
    method: 'PUT',
    data: data,
    isShowMessage: true
  })
}



export function roleDetail(data) {
  return request({
    url: `${baseURL}/${data.id}`,
    method: 'get',
    params: data,
    isShowMessage: false
  })
}

export function deleteRole(data) {
  return request({
    url: `${baseURL}/deleteRole/${data.id}`,
    method: 'DELETE',
    params: data,
    isShowMessage: false
  })
}


